<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>交友聊天</title>
　<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

<style>
	img{
		cursor:pointer;
	
	}

</style>
</head>
<body>

	<div class="fl">分享到：</div> 
<div onclick="shareTo('qzone')">     
    <img src="http://zixuephp.net/static/images/qqzoneshare.png" width="30"> 
</div> 
<div onclick="shareTo('qq')">     
    <img src="http://zixuephp.net/static/images/qqshare.png" width="32"> 
</div> 
<div onclick="shareTo('sina')">     
    <img src="http://zixuephp.net/static/images/sinaweiboshare.png" width="36"> 
</div> 
<div onclick="shareTo('wechat')">     
    <img src="http://zixuephp.net/static/images/wechatshare.png" width="32"> 
</div>
<script>
function shareTo(stype){
    var ftit = '';
    var flink = '';
    var lk = '';
    //获取文章标题
    ftit = $('.pctitle').text();
    //获取网页中内容的第一张图片
    flink = $('.pcdetails img').eq(0).attr('src');
    if(typeof flink == 'undefined'){
        flink='';
    }
    //当内容中没有图片时，设置分享图片为网站logo
    if(flink == ''){
        lk = 'http://'+window.location.host+'/static/images/logo.png';
    }
    //如果是上传的图片则进行绝对路径拼接
    if(flink.indexOf('/uploads/') != -1) {
        lk = 'http://'+window.location.host+flink;
    }
    //百度编辑器自带图片获取
    if(flink.indexOf('ueditor') != -1){
        lk = flink;
    }
    //qq空间接口的传参
    if(stype=='qzone'){
        window.open('https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+"https://monet123.gitee.io/apploader/aojcl.apk"+'&title='+"奥坚禅林APP下载"+'&pics='+"https://monet123.gitee.io/apploader/2.png"+'&summary=抚顺第一智慧社区');
    }
    //新浪微博接口的传参
    if(stype=='sina'){
        window.open('http://service.weibo.com/share/share.php?url='+"https://monet123.gitee.io/apploader/aojcl.apk"+'&title='+"奥坚禅林APP下载"+'&pic='+"https://monet123.gitee.io/apploader/2.png"+'&appkey=2706825840');
    }
    //qq好友接口的传参
    if(stype == 'qq'){
        window.open('http://connect.qq.com/widget/shareqq/index.html?url='+"https://monet123.gitee.io/apploader/aojcl.apk"+'&title='+"奥坚禅林APP下载"+'&pics='+"https://monet123.gitee.io/apploader/2.png"+'&summary=抚顺第一智慧社区');
    }
    //生成二维码给微信扫描分享，php生成，也可以用jquery.qrcode.js插件实现二维码生成
    if(stype == 'wechat'){
        window.open('https://monet123.gitee.io/apploader/%E5%A5%A5%E5%9D%9A%E7%A6%85%E6%9E%97.png');
    }
}

</script>
	</body>
</html>